#pragma once
#include "dcl_ModelImport.h"
class DEF_MODELIMPORT CReadDataForGAJ
{
public:
	CReadDataForGAJ(void);
	~CReadDataForGAJ(void);

	CIdsFullData* ReadData(std::list<CString> lstExcelFileName,CIdsFullData *pOldSystem, bool bAddToActiveDoc,bool bIncrementalUpdate);
	bool ReadInExcel(CString sFilePath,CSystem *pSystem);
	void GetCableFiles( CString strPath,std::list<CString> &lstExcelFileName );

	void CheckAndCreatSubsystem(CSystem *pSystem,CString sName,CSubSystem* &pSubSystem);
	void CheckAndCreatDevice(CSystem *pSystem,CString sName,CSubSystem* pSubSytem,CDevice* &pDevice);
	void CreatePin(CSystem *pSystem,CPin* pPin1,CPin* pPin2,CWire* pWire,CConnector *pStartConnector,CConnector *pEndConnector,CString strStartPin,CString strEndPin);
	void CheckAndCreateCable(CCable *&pCable,CString sCableNo,CSystem *pSystem);
	void CheckAndCreateConnector(CDevice *pDevice,CString sCode,CConnector *&pConnector);
	void CheckAndCreateSubCable(CSubCable *&pSubCable,CString sNo,CCable *pCable,CConnector *pStartConnector,CConnector *pEndConnector,CSystem* pSystem);
	CWire* CheckAndCreatePinWire(CSubCable *pSubCable,CConnector *pStartConnector,CConnector *pEndConnector,CString sStPin,CString sEndPin,CSystem* pSystem);

	bool GetSubCableByStAndEndConCode(CSystem* pSystem,CConnector* pStartCon,CConnector* pEndCon,CSubCable* &pSubCable);
	bool CheckAndDeleteWiresOfSubcable(CSubCable* pSubCable,CString sStConCode,CString sEndConCode);
public:
	void SetStepCount(long lstep){lStepCount=lstep;}
	long GetStepCount(){return lStepCount;}
	void SetStepInfo(CString sInfo){sStepInfo=sInfo;}
	CString GetStepInfo(){return sStepInfo;}
private:
	long lStepCount;
	CString sStepInfo;
};

